﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="favicon.ico" />
<link href="user/css/UserCenter.css?v=<?=WEB_VERSION?>" rel="stylesheet" type="text/css" />
<script src="user/js/jquery-1.7.1.min.js?v=<?=WEB_VERSION?>" type="text/javascript" language="javascript"></script>
<script type="text/javascript" src="user/js/home.min.js?v=<?=WEB_VERSION?>"></script>
<script type="text/javascript" src="js_reserveCourse.htm"></script>
<title>100课堂英语学习会员中心</title>
</head>
<body>
    <?php
    	//初始化活动的页面
    	$userInfo = HttpDaoManager::getUserDao()->get($_SESSION['user']['id']);
    	$userKindActiveFlg = HttpServerManager::getUserServer()->validateUserActiveKind($userInfo);
    	if($userKindActiveFlg==true){
			$targetCourseList = Common::_t('target_course_list');
			$initCourseArray = $targetCourseList[$userInfo['user_kind']];
			$init_selected_course_type = $initCourseArray['course_type'];
			$init_selected_course_list = $initCourseArray['course_list'];
			if(!empty($init_selected_course_list)){
				$init_selected_course = $init_selected_course_list['0'];
			}else{
				$courseList = HttpDaoManager::getCourseDao()->getListByType($init_selected_course_type) ;
				$courseIdList = Common::array_value_list($courseList, 'id');
				asort($courseIdList);
				$init_selected_course =$courseIdList[0];//获取最小的1个
			}
    	}
	?>	
<div class="U_Center" style="width:650px; height:auto; margin:0 auto; background:#F0F4F7; border:0px solid #C1D1E1; border-bottom:0;">
    <div class="Fr" style="width:650px;">
    <form action="user_subUpdateBooking.htm" name="Form1" method="post">
    <input name="id" id="id" type="hidden" value="<?=$_GET['id']?>" />
        <div class="Y_open2" style="border-left: 0px;padding:0px;margin-left:0px;">
			<div class="Y_oprw" style="margin-left:10px;">
            	<div class="YopTio">请选择课程与教材</div>
                <div class="YopTix">
				<div class="clearc"></div>
          <div class="rc_box" style="clear: both;">
           <div style="overflow: hidden;">
                  <div class="YRiude" id='topcourse'>
		                     <?
		                     if(!$userKindActiveFlg){
		                	  foreach ($course_type as $k=>$v){
						 	 ?>
		                    	<div id="Ra<?=$k?>"><input type="radio" name="course_type_radio" value="<?=$k?>"  /><?=$v?></div>
		                        <?
							  }}else{
							 $courseTypeName = $course_type[$init_selected_course_type];  
							 ?>
							 <div id="Ra<?=$init_selected_course_type?>"><input type="radio" name="course_type_radio" value="<?=$init_selected_course_type?>" style="display: none"/></div>
							 <?
							 }
							?>
                        <div class="clearc"></div>
                    </div>                         
 			 <div  id="subcoursecontenuer"  style='clear:both; width:100%; display:none;'>
				 	<div class="rc_line_title"><span id='subcoursetitle'>综合英语</span>&gt;&gt;</div>
                 <div style='width:100%;height:auto;'>
					<ul id='subcourse_ul'>
                    </ul>
                 </div>
             </div>
             <div id='thirdcoursecontenuer' style='clear:both;width:100%;display: none;'>
			   <div class="rc_line_title"><span id="thirdcoursetitle">学习课程&gt;&gt;</span></div>
               <div style='width:100%;height:30px; font-size:13px; text-indent:1em;'>
                   	选择课程：
                   <select name="ThirdCourse" class="GreyBrim" id='thirdcourse'></select>
                   <a href="javascript:;" id="view_course" style="display:none;"><img src="user/images/wezc2.jpg" /></a>
                </div>
                </div>
                </div>
                </div>
                    <div class="clearc"></div>
                    
                </div>
                <div class="YopT"></div>
            </div>
            <div class="clearc"></div>
        </div>
        <div class="Y_open3" style="display: none">
			<div class="Y_oprw">
            	<div class="YopTio">上传资料</div>
                <div class="YopTix">
					<input name="teaching_material" type="file" />
                </div>
                <div class="YopT"></div>
            </div>
            <div class="clearc"></div>
        </div>
    <div class="clearc"></div>
   </form>
   <form id="view_course_form" style="display:none" target="_blank" method="post" action=""></form>
   </div>
        <div class="YCU3" style="margin-left:30px;">
        	<input type="button" value="确认" id="confirm_update" style="background:#A5C94B; margin-right:2px; padding:3px 10px; color:#fff;">
        	<input type="button" value="关闭" onClick="window.close();"  style="background:#A5C94B; margin-right:2px; padding:3px 10px; color:#fff;">
        </div>
   <div class="clearc"></div>
</div>
<? 
if($userKindActiveFlg){
?>
<script>
$(document).ready( function(){
	$('input[name="course_type_radio"]').each(function(){
		var course_type = $(this).val();
		if(course_type==<?=$select_course_type?>){
			$(this).attr('checked',true);
			$('input[name="course_type_radio"]:checked').trigger('click');
		}
	})

	$('input[name="course"]').each(function(){
		var course = $(this).val();
		if(course==<?=$select_course?>){
			$(this).attr('checked',true);
			$('input[name="course"]:checked').trigger('click');
		}
		
	})
	$("#thirdcourse").find("option[value='<?=$select_chapter?>']").attr("selected",true);	
})
</script> 
<?}?>
 <script type="text/javascript" src="user/js/user_booking.min.js?v=<?=WEB_VERSION?>"></script>
</body>
</html>
